import axios from '../../axios'
const SALES_URL = "/sales"
const salesApi = {
    //新增销售
    addSales(sale) {
        return axios({
            url: SALES_URL + "/addSales",
            method: 'post',
            data: sale,

        });
    },
    //获取所有销售信息
    getAllSales(params) {
        return axios({
            url: SALES_URL + "/getSales",
            method: 'get',
            params,
        });
    },
    //删除销售
    deleteOne(_id) {
        return axios({
            url: SALES_URL + "/deteSalesById",
            method: 'post',
            data: { _id },
        });
    },
    //获取修改的信息
    getUpdataSale(_id) {
        return axios({
            url: SALES_URL + "/getUpdataOne",
            method: 'get',
            params: { _id },
        });
    },
    //确认修改
    sureUpdataOne(sale) {
        return axios({
            url: SALES_URL + "/SureupdataOne",
            method: 'post',
            data: sale,
        });
    },

    //获取所有客户
    getClients(params) {
        return axios({
            url: '/clients/getClient',
            method: 'get',
            params
        })
    },


}

export default salesApi;